#实现一个协程测试脚步

from greenlet import greenlet
import time

def a():
    while True:
        print("----A----")
        time.sleep(0.5)
        gr2.switch()

def b():
    while True:
        print('----B----')
        time.sleep(0.5)
        gr1.switch()
    

gr1 = greenlet(a)
gr2 = greenlet(b)

gr1.switch()
